[SPARK-9750][MLlib] Improve equals on SparseMatrix and DenseMatrix#8042
[SPARK-9750][MLlib] Improve equals on SparseMatrix and DenseMatrix#8042feynmanliang wants to merge 6 commits intoapache:masterfrom
Conversation
|
To start the discussion; should a |
|
Test build #40202 has finished for PR 8042 at commit
|
|
Jenkins test please |
|
Jenkins test this please |
If we follow Breeze's example, then we should define equality in semantics, not representation. I think this PR is valid. |
|
Test build #1420 has finished for PR 8042 at commit
|
There was a problem hiding this comment.
This case should be for Matrix, not just SparseMatrix.
There was a problem hiding this comment.
OK.
Will also change DenseMatrix.equals.
|
Test build #40320 has finished for PR 8042 at commit
|
There was a problem hiding this comment.
I like what you had before better. Using Breeze, I think you'd avoid converting to dense representations. With toArray, it becomes dense.
There was a problem hiding this comment.
Totally forgot about that, thanks.
There was a problem hiding this comment.
You could replace toArray with toBreeze here too, in case "o" is sparse
|
LGTM pending tests |
|
Test build #40488 has finished for PR 8042 at commit
|
|
Merging with master and branch-1.5 |
Adds unit test for `equals` on `mllib.linalg.Matrix` class and `equals` to both `SparseMatrix` and `DenseMatrix`. Supports equality testing between `SparseMatrix` and `DenseMatrix`. mengxr Author: Feynman Liang <fliang@databricks.com> Closes #8042 from feynmanliang/SPARK-9750 and squashes the following commits: bb70d5e [Feynman Liang] Breeze compare for dense matrices as well, in case other is sparse ab6f3c8 [Feynman Liang] Sparse matrix compare for equals 22782df [Feynman Liang] Add equality based on matrix semantics, not representation 78f9426 [Feynman Liang] Add casts 43d28fa [Feynman Liang] Fix failing test 6416fa0 [Feynman Liang] Add failing sparse matrix equals tests (cherry picked from commit 520ad44) Signed-off-by: Joseph K. Bradley <joseph@databricks.com>
|
@feynmanliang The contract for Java's |
|
@mengxr made SPARK-9919 to track this |
Adds unit test for `equals` on `mllib.linalg.Matrix` class and `equals` to both `SparseMatrix` and `DenseMatrix`. Supports equality testing between `SparseMatrix` and `DenseMatrix`. mengxr Author: Feynman Liang <fliang@databricks.com> Closes apache#8042 from feynmanliang/SPARK-9750 and squashes the following commits: bb70d5e [Feynman Liang] Breeze compare for dense matrices as well, in case other is sparse ab6f3c8 [Feynman Liang] Sparse matrix compare for equals 22782df [Feynman Liang] Add equality based on matrix semantics, not representation 78f9426 [Feynman Liang] Add casts 43d28fa [Feynman Liang] Fix failing test 6416fa0 [Feynman Liang] Add failing sparse matrix equals tests
Adds unit test for
equalsonmllib.linalg.Matrixclass andequalsto bothSparseMatrixandDenseMatrix. Supports equality testing betweenSparseMatrixandDenseMatrix.@mengxr